from premier_league import RankingTable# Get current season standingsranking = RankingTable()standings = ranking.get_ranking_list()# Display top 5 teamsprint(standings[0]) # Header rowfor team in standings[1:6]: print(team)
from premier_league import PlayerSeasonLeaders# Get top 10 goalscorersscorers = PlayerSeasonLeaders(stat_type='G')top_scorers = scorers.get_top_stats_list(limit=10)# Display resultsfor player in top_scorers[1:]: # Skip header print(f"{player[0]} ({player[2]}): {player[3]} goals")
from premier_league import MatchStatisticsfrom datetime import datetime# Initialize match statisticsstats = MatchStatistics()# Get Arsenal's recent gamesarsenal_games = stats.get_team_games("Arsenal")# Get games before a specific daterecent_games = stats.get_games_before_date( date=datetime(2024, 2, 1), limit=5, team="Liverpool")print(f"Found {len(arsenal_games)} Arsenal games")
4
Check transfer activity
View player transfers for a team:
from premier_league import Transfers# Initialize transfers for current seasontransfers = Transfers()# Get Chelsea's incoming transferschelsea_ins = transfers.transfer_in_table("Chelsea")# Display transfersprint(chelsea_ins[0]) # Headerfor transfer in chelsea_ins[1:]: print(transfer)
All modules support exporting data in multiple formats:
from premier_league import RankingTable, PlayerSeasonLeaders# Export standings to CSVranking = RankingTable()ranking.get_ranking_csv("standings_2024", header="Premier League 2023-24")# Export top scorers to JSONscorers = PlayerSeasonLeaders(stat_type='G')scorers.get_top_stats_json("top_scorers", header="Goals_2024")# Export to PDF (requires premier_league[pdf])ranking.get_ranking_pdf("standings_2024")